package com.small.nacos.core.cluster.lookup;

import com.small.nacos.core.cluster.MemberLookup;
import com.small.nacos.core.cluster.ServerMemberManager;
import com.small.nacos.sys.env.EnvUtil;

/**
 * @Author zhoujin
 * @Date 2022/11/9 14:27
 */
public class LookupFactory {


    private static MemberLookup LOOK_UP = null;

    /**
     * 创建成员查找器
     * @param memberManager
     * @return
     */
    public static MemberLookup createLookUp(ServerMemberManager memberManager) {
        if (!EnvUtil.getStandaloneMode()) {
            LOOK_UP = new FileConfigMemberLookup();
        }else {
            LOOK_UP = new StandaloneMemberLookup();
        }
        LOOK_UP.injectMemberManager(memberManager);
        return LOOK_UP;
    }

}
